package com.androidx.p013lv.base.p014db;

import android.database.Cursor;
import android.database.sqlite.SQLiteStatement;
import com.androidx.p013lv.base.bean.AdInfoBean;
import java.util.Date;
import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.Property;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.database.DatabaseStatement;
import org.greenrobot.greendao.internal.DaoConfig;

/* renamed from: com.androidx.lv.base.db.AdInfoBeanDao */
public class AdInfoBeanDao extends AbstractDao<AdInfoBean, Long> {
    public static final String TABLENAME = "AD_INFO_BEAN";

    /* renamed from: com.androidx.lv.base.db.AdInfoBeanDao$Properties */
    public static class Properties {
        public static final Property AdId = new Property(1, Integer.TYPE, "adId", false, "AD_ID");
        public static final Property AdImage = new Property(2, String.class, "adImage", false, "AD_IMAGE");
        public static final Property AdJump = new Property(3, String.class, "adJump", false, "AD_JUMP");
        public static final Property AdPlay = new Property(4, String.class, "adPlay", false, "AD_PLAY");
        public static final Property AdSort = new Property(5, Double.class, "adSort", false, "AD_SORT");
        public static final Property AdStartTime = new Property(6, Date.class, "adStartTime", false, "AD_START_TIME");
        public static final Property AdStopTime = new Property(7, Date.class, "adStopTime", false, "AD_STOP_TIME");
        public static final Property AdType = new Property(8, String.class, "adType", false, "AD_TYPE");
        public static final Property AdWeight = new Property(9, Integer.TYPE, "adWeight", false, "AD_WEIGHT");
        public static final Property Idd = new Property(0, Long.class, "idd", true, "_id");
        public static final Property JumpType = new Property(10, Integer.TYPE, "jumpType", false, "JUMP_TYPE");
        public static final Property MinStaySecond = new Property(11, Integer.TYPE, "minStaySecond", false, "MIN_STAY_SECOND");
        public static final Property PlaceId = new Property(12, String.class, "placeId", false, "PLACE_ID");
    }

    /* access modifiers changed from: protected */
    @Override // org.greenrobot.greendao.AbstractDao
    public final boolean isEntityUpdateable() {
        return true;
    }

    public AdInfoBeanDao(DaoConfig daoConfig) {
        super(daoConfig);
    }

    public AdInfoBeanDao(DaoConfig daoConfig, DaoSession daoSession) {
        super(daoConfig, daoSession);
    }

    public static void createTable(Database database, boolean z) {
        String str = z ? "IF NOT EXISTS " : "";
        database.execSQL("CREATE TABLE " + str + "\"AD_INFO_BEAN\" (\"_id\" INTEGER PRIMARY KEY AUTOINCREMENT ,\"AD_ID\" INTEGER NOT NULL ,\"AD_IMAGE\" TEXT,\"AD_JUMP\" TEXT,\"AD_PLAY\" TEXT,\"AD_SORT\" REAL,\"AD_START_TIME\" INTEGER,\"AD_STOP_TIME\" INTEGER,\"AD_TYPE\" TEXT,\"AD_WEIGHT\" INTEGER NOT NULL ,\"JUMP_TYPE\" INTEGER NOT NULL ,\"MIN_STAY_SECOND\" INTEGER NOT NULL ,\"PLACE_ID\" TEXT);");
    }

    public static void dropTable(Database database, boolean z) {
        StringBuilder sb = new StringBuilder();
        sb.append("DROP TABLE ");
        sb.append(z ? "IF EXISTS " : "");
        sb.append("\"AD_INFO_BEAN\"");
        database.execSQL(sb.toString());
    }

    /* access modifiers changed from: protected */
    public final void bindValues(DatabaseStatement databaseStatement, AdInfoBean adInfoBean) {
        databaseStatement.clearBindings();
        Long idd = adInfoBean.getIdd();
        if (idd != null) {
            databaseStatement.bindLong(1, idd.longValue());
        }
        databaseStatement.bindLong(2, (long) adInfoBean.getAdId());
        String adImage = adInfoBean.getAdImage();
        if (adImage != null) {
            databaseStatement.bindString(3, adImage);
        }
        String adJump = adInfoBean.getAdJump();
        if (adJump != null) {
            databaseStatement.bindString(4, adJump);
        }
        String adPlay = adInfoBean.getAdPlay();
        if (adPlay != null) {
            databaseStatement.bindString(5, adPlay);
        }
        Double adSort = adInfoBean.getAdSort();
        if (adSort != null) {
            databaseStatement.bindDouble(6, adSort.doubleValue());
        }
        Date adStartTime = adInfoBean.getAdStartTime();
        if (adStartTime != null) {
            databaseStatement.bindLong(7, adStartTime.getTime());
        }
        Date adStopTime = adInfoBean.getAdStopTime();
        if (adStopTime != null) {
            databaseStatement.bindLong(8, adStopTime.getTime());
        }
        String adType = adInfoBean.getAdType();
        if (adType != null) {
            databaseStatement.bindString(9, adType);
        }
        databaseStatement.bindLong(10, (long) adInfoBean.getAdWeight());
        databaseStatement.bindLong(11, (long) adInfoBean.getJumpType());
        databaseStatement.bindLong(12, (long) adInfoBean.getMinStaySecond());
        String placeId = adInfoBean.getPlaceId();
        if (placeId != null) {
            databaseStatement.bindString(13, placeId);
        }
    }

    /* access modifiers changed from: protected */
    public final void bindValues(SQLiteStatement sQLiteStatement, AdInfoBean adInfoBean) {
        sQLiteStatement.clearBindings();
        Long idd = adInfoBean.getIdd();
        if (idd != null) {
            sQLiteStatement.bindLong(1, idd.longValue());
        }
        sQLiteStatement.bindLong(2, (long) adInfoBean.getAdId());
        String adImage = adInfoBean.getAdImage();
        if (adImage != null) {
            sQLiteStatement.bindString(3, adImage);
        }
        String adJump = adInfoBean.getAdJump();
        if (adJump != null) {
            sQLiteStatement.bindString(4, adJump);
        }
        String adPlay = adInfoBean.getAdPlay();
        if (adPlay != null) {
            sQLiteStatement.bindString(5, adPlay);
        }
        Double adSort = adInfoBean.getAdSort();
        if (adSort != null) {
            sQLiteStatement.bindDouble(6, adSort.doubleValue());
        }
        Date adStartTime = adInfoBean.getAdStartTime();
        if (adStartTime != null) {
            sQLiteStatement.bindLong(7, adStartTime.getTime());
        }
        Date adStopTime = adInfoBean.getAdStopTime();
        if (adStopTime != null) {
            sQLiteStatement.bindLong(8, adStopTime.getTime());
        }
        String adType = adInfoBean.getAdType();
        if (adType != null) {
            sQLiteStatement.bindString(9, adType);
        }
        sQLiteStatement.bindLong(10, (long) adInfoBean.getAdWeight());
        sQLiteStatement.bindLong(11, (long) adInfoBean.getJumpType());
        sQLiteStatement.bindLong(12, (long) adInfoBean.getMinStaySecond());
        String placeId = adInfoBean.getPlaceId();
        if (placeId != null) {
            sQLiteStatement.bindString(13, placeId);
        }
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public Long readKey(Cursor cursor, int i) {
        int i2 = i + 0;
        if (cursor.isNull(i2)) {
            return null;
        }
        return Long.valueOf(cursor.getLong(i2));
    }

    @Override // org.greenrobot.greendao.AbstractDao
    public AdInfoBean readEntity(Cursor cursor, int i) {
        int i2 = i + 0;
        Long valueOf = cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2));
        int i3 = cursor.getInt(i + 1);
        int i4 = i + 2;
        String string = cursor.isNull(i4) ? null : cursor.getString(i4);
        int i5 = i + 3;
        String string2 = cursor.isNull(i5) ? null : cursor.getString(i5);
        int i6 = i + 4;
        String string3 = cursor.isNull(i6) ? null : cursor.getString(i6);
        int i7 = i + 5;
        Double valueOf2 = cursor.isNull(i7) ? null : Double.valueOf(cursor.getDouble(i7));
        int i8 = i + 6;
        Date date = cursor.isNull(i8) ? null : new Date(cursor.getLong(i8));
        int i9 = i + 7;
        int i10 = i + 8;
        int i11 = i + 12;
        return new AdInfoBean(valueOf, i3, string, string2, string3, valueOf2, date, cursor.isNull(i9) ? null : new Date(cursor.getLong(i9)), cursor.isNull(i10) ? null : cursor.getString(i10), cursor.getInt(i + 9), cursor.getInt(i + 10), cursor.getInt(i + 11), cursor.isNull(i11) ? null : cursor.getString(i11));
    }

    public void readEntity(Cursor cursor, AdInfoBean adInfoBean, int i) {
        int i2 = i + 0;
        String str = null;
        adInfoBean.setIdd(cursor.isNull(i2) ? null : Long.valueOf(cursor.getLong(i2)));
        adInfoBean.setAdId(cursor.getInt(i + 1));
        int i3 = i + 2;
        adInfoBean.setAdImage(cursor.isNull(i3) ? null : cursor.getString(i3));
        int i4 = i + 3;
        adInfoBean.setAdJump(cursor.isNull(i4) ? null : cursor.getString(i4));
        int i5 = i + 4;
        adInfoBean.setAdPlay(cursor.isNull(i5) ? null : cursor.getString(i5));
        int i6 = i + 5;
        adInfoBean.setAdSort(cursor.isNull(i6) ? null : Double.valueOf(cursor.getDouble(i6)));
        int i7 = i + 6;
        adInfoBean.setAdStartTime(cursor.isNull(i7) ? null : new Date(cursor.getLong(i7)));
        int i8 = i + 7;
        adInfoBean.setAdStopTime(cursor.isNull(i8) ? null : new Date(cursor.getLong(i8)));
        int i9 = i + 8;
        adInfoBean.setAdType(cursor.isNull(i9) ? null : cursor.getString(i9));
        adInfoBean.setAdWeight(cursor.getInt(i + 9));
        adInfoBean.setJumpType(cursor.getInt(i + 10));
        adInfoBean.setMinStaySecond(cursor.getInt(i + 11));
        int i10 = i + 12;
        if (!cursor.isNull(i10)) {
            str = cursor.getString(i10);
        }
        adInfoBean.setPlaceId(str);
    }

    /* access modifiers changed from: protected */
    public final Long updateKeyAfterInsert(AdInfoBean adInfoBean, long j) {
        adInfoBean.setIdd(Long.valueOf(j));
        return Long.valueOf(j);
    }

    public Long getKey(AdInfoBean adInfoBean) {
        if (adInfoBean != null) {
            return adInfoBean.getIdd();
        }
        return null;
    }

    public boolean hasKey(AdInfoBean adInfoBean) {
        return adInfoBean.getIdd() != null;
    }
}
